<?php
session_start();

require('dataaccess.php');
$nonce = $_POST['nonce'];
$pkgid = $_POST['pkgid'];
$locid = $_POST['locid'];
$down = $_POST['down'];
$up = $_POST['up'];
$userid = 1;

$session_nonce = $_SESSION['nonce'];

if ( $nonce == $session_nonce ) {
    $result = saveSpeedTest($down, $up, $userid, $locid, $pkgid);
    if ($result) {echo 'kthx'; } else { echo 'fail'; };
};
?>